import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routers'
import store from '@/store'

Vue.use(VueRouter)

const router = new VueRouter({
  routes
})

router.beforeEach((to, from, next) => {
  // console.log('beforeEach')
  const { isBackShow, title } = to.meta
  store.commit('changeIsBackShowAndTitle', { isBackShow, title })
  next()
})
export default router
